# coding=utf-8

import matplotlib.pyplot as plt
import numpy as np
import struct

def main():
    resolution = (200, 200)
    binfile = open("D:/Learn/solar_software/solar_3/6282.bin", "rb")
    binfile_data = binfile.read()
    float_data = struct.unpack("f" * resolution[0] * resolution[1], binfile_data)

    X = np.array(float_data, dtype=np.float32).reshape([200, 200])
    fig = plt.figure(figsize=(200, 200))
    plt.imshow(X)
    # plt.colorbar().set_ticks([0, 40, 80, 120])
    plt.colorbar()
    plt.title("FluxMap")
    plt.show()

if __name__ == "__main__":
    main()
